package com.xiaocikuai.smallchunks.mapper.Transaction;

import com.xiaocikuai.smallchunks.entity.Transaction.Order;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import org.apache.ibatis.annotations.Select;
import org.apache.ibatis.annotations.Update;

import java.time.LocalDateTime;
import java.util.List;

/**
 * <p>
 *  Mapper 接口
 * </p>
 *
 * @author author1
 * @since 2024-07-13
 */

public interface OrderMapper extends BaseMapper<Order> {

    @Select("select * from yshop_order where status = #{status} and create_time < #{orderTime}")
    List<Order> getByStatusAndOrdertimeLT(Integer status, LocalDateTime orderTime);


    @Update("update yshop_order set  status = -1 where oid = #{oid}")
    void updateOrderDetailStatus(Order order);

}
